package com.mars.module.admin.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.*;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.mars.module.system.entity.BaseEntity;

import java.time.LocalDateTime;

/**
 * 社区对象 sys_community
 *
 * @author mars
 * @date 2024-04-04
 */

@Data
@ApiModel(value = "社区对象")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("sys_community")
public class SysCommunity {

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "id")
    private Long id;
    /**
     * 标题
     */
    @Excel(name = "标题")
    @ApiModelProperty(value = "标题")
    private String title;
    /**
     * 内容
     */
    @Excel(name = "内容")
    @ApiModelProperty(value = "内容")
    private String content;
    /**
     * 图片或者视频
     */
    @Excel(name = "图片或者视频")
    @ApiModelProperty(value = "图片或者视频")
    private String url;
    /**
     * 状态
     */
    @Excel(name = "状态")
    @ApiModelProperty(value = "状态")
    private String status;
    /**
     * 发帖人
     */
    @Excel(name = "发帖人")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "发帖人")
    private Long userId;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "创建人ID")
    private Long createById;

    @TableField(exist = false)
    @ApiModelProperty(value = "用户姓名")
    private String userName;

    @TableField(exist = false)
    @ApiModelProperty(value = "是否点赞")
    private String isLike;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "分类")
    private Long classId;

    @TableField(exist = false)
    @ApiModelProperty(value = "分类名称")
    private String className;


    @TableField(exist = false)
    @ApiModelProperty(value = "头像")
    private String avatar;
}
